package com.cat.DataStructure04;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k/
 * @create 2025/11/26 18:43
 * @since JDK17
 */

public class Solution18 {
    public int minOperations(int k) {
        int max = ((int) Math.ceil(Math.sqrt(k)));
        return (max - 1) + (k + max - 1) / max;
    }
}
